#ifndef BOYAA_DBPART_H_20090707
#define BOYAA_DBPART_H_20090707

#include <global.h>
#include <map>
#include <vector>
#include <set>
#include "def.h"
#include "baseDbPart.h"

class CDbPart
{
public:
	CDbPart();
	virtual ~CDbPart();

public:
    bool getOldestGameTecordItem(const std::string& tname, _u64_& seq, int& nodataflag);
	bool delGameTecordItem();
	bool getYmInfo(const std::string& tname, const std::string& ym, unsigned int& seq, int& nodataflag);
	bool addYearMonth(const std::string& tname, const std::string& ym, const unsigned int seq);
	bool getFirstMonth(const std::string& tname, std::pair<std::string, unsigned int>& month, int& nodataflag);
	bool createRecordTable(const std::string& tname);
	bool addRecord(const std::string& tname, const unsigned int uid, const unsigned int useq, const std::string& roundid, const int64 bet, const int betact,  const int64 win, const int winact, const int64 betamount
		,const int64 winamount, const _u64_ tt, const int dayfirstflag, const std::string& detail);
	_u64_ getLastSqlId(void);
	bool getUserRecordCount(const std::string& tname, const unsigned int uid, const unsigned int mod, unsigned int& count, int& nodataflag);
	bool addUserRecordCount(const std::string& tname, const unsigned int uid, const unsigned int mod, const unsigned int delt);
	bool insertAndaddUserRecordCount(const std::string& tname, const unsigned int uid, const unsigned int mod, const unsigned int delt, const int timezoneinmin);
	bool createGameRecordCountTable(const std::string& tname);
	bool createMonthListTable(const std::string& tname);
	bool getAgencyArea(const unsigned int agencyid, std::string& area, int& nodataflag);
	bool addTableRecord(const std::string& tname, const unsigned int game, const unsigned int ym, const unsigned int uidmod, const _u64_ rt);
public:
	CBaseDbPart* m_dbHandler;
};
#endif
